package net.oschina.sql.postgresql;

import org.apache.commons.lang3.text.translate.CharSequenceTranslator;

import org.apache.commons.lang3.text.translate.LookupTranslator;
import org.apache.commons.lang3.text.translate.UnicodeEscaper;
/**
 *  
 * /
 
public class StringEscapeUtils {
	public static final CharSequenceTranslator ESCAPE_SQL = new LookupTranslator(new String[][] { { "\b", "\\b" },
			{ "\\", "\\\\" }, { "'", "''" }, { "\t", "\\t" }, { "\f", "\\f" }, { "\r", "\\r" }, { "\n", "\\n" } })
					.with(UnicodeEscaper.outsideOf(32, 0x7f));

	public static final String escapeSQL(final String input) {
		return ESCAPE_SQL.translate(input);
	}

}